import 'package:flutter/material.dart';
import 'package:my_app/demo/listView_demo.dart';
// import 'demo/listView_demo.dart';
import 'demo/draw_demo.dart';
import 'demo/bottomNavgtionBar_demo.dart';
import 'demo/basic_demo.dart';
import 'demo/layout_demo.dart';
import 'demo/view_demo.dart';
import 'demo/sliver_demo.dart';
import 'demo/navigator_demo.dart';
import 'demo/state/state_management.dart';
import 'demo/stream/stream_demo.dart';
import 'demo/rxDart/rxDart_demo.dart';
import 'demo/bloc/bloc_demo.dart';
void main() => runApp(App());

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: StateManagermentDemo(),
      initialRoute: '/bloc',
      routes: {
        '/about': (context) => Page(
              title: "About",
            ),
        '/home': (context) => Home(),
        '/state_managerment': (context) => StateManagermentDemo(),
        '/stream': (context) => StreamDemo(),
        '/rxdart': (context) => RxDartDemo(),
        '/bloc': (context)=>BlocDemo(),
      },
      theme: ThemeData(
          primaryColor: Colors.yellow,
          highlightColor: Color.fromRGBO(255, 255, 255, 0.5),
          splashColor: Colors.white54),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return DefaultTabController(
      length: 5,
      child: Scaffold(
          appBar: AppBar(
            title: Text('APP'),
            // leading: IconButton(
            //   icon: Icon(
            //     Icons.menu,
            //   ),
            //   tooltip: 'Navigration',
            //   onPressed: () => debugPrint('Navigation button is pressed'),
            // ),
            actions: <Widget>[
              IconButton(
                icon: Icon(Icons.search),
                tooltip: 'serach',
                onPressed: null,
              )
            ],
            elevation: 4.0,
            bottom: TabBar(
              unselectedLabelColor: Colors.black45,
              indicatorColor: Colors.black54,
              indicatorSize: TabBarIndicatorSize.label,
              indicatorWeight: 2.0,
              tabs: <Widget>[
                Tab(icon: Icon(Icons.local_florist)),
                Tab(icon: Icon(Icons.change_history)),
                Tab(icon: Icon(Icons.directions_bike)),
                Tab(
                  icon: Icon(Icons.view_quilt),
                ),
                Tab(
                  icon: Icon(Icons.view_column),
                )
              ],
            ),
          ),
          body: TabBarView(
            children: <Widget>[
              ListViewDemo(),
              BasicDemo(),
              LayoutDemo(),
              ViewDemo(),
              SliverDemo()
            ],
          ),
          drawer: SafeArea(child: DrawDemo()),
          bottomNavigationBar: BottomNavigationBarDemo()),
    );
  }
}
